package com.xiaocg.flyweight;

public class FlyWeightTest {
    public static void main(String[] args) {
        BoxFactory instance = BoxFactory.getInstance();
        AbstractBox i1 = instance.getBox("i");
        i1.display("红色");
        AbstractBox i2 = instance.getBox("i");
        i2.display("灰色");

        System.out.println(i1==i2);

        Integer d = 1;

    }
}
